﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Librerias;

namespace Aplicacion.admin
{
    public partial class Admin : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!Debugger.IsAttached)
            //{
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("es-ES");
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("es");


            try
            {
                if (Session["usuario"] == null)
                {
                    Response.Redirect("~/admin/default.aspx");
                }
                else
                {
                    var usuario = (ObjetoAd)Session["usuario"];

                    DisplayName = usuario.DisplayName;

                    if (Session["mensaje"] != null)
                        ltlErrores.Text = Session["mensaje"].ToString();
                    Session["mensaje"] = null;
                }
            }
            catch (Exception)
            {
                
                throw;
            }
            
        }


        ///<summary>
        ///</summary>
        public string DisplayName
        {
            get
            {
                return litUsuario.Text;
            }

            set
            {
                litUsuario.Text = value;
            }
        }
        ///<summary>
        ///</summary>
        public string Ruta
        {
            get
            {
                return this.ResolveUrl("~/admin").ToString();
            }
        }
    }
}